<template>
<div>
  <h1>登录页面</h1>
  用户名: <input type="text" v-model="form.yhm"><br>
  用户密码: <input type="text" v-model="form.pasdword"><br>
  <button @click="deng">登录</button>
  <button @click="zhu">注册</button>
</div>
</template>

<script>
export default {
name: "ad_4",
  data(){
  return{
    form:{}
  }
  },
  methods:{
  zhu(){
    this.$router.push('/ad_/')
  },
  deng(){
    this.axios.post('user/Deng/',this.form)
    .then(res=>{
      localStorage.setItem('userid',res.data.userid)
      alert('登录成功')
      this.$router.push('/ad_3/')
      // localStorage.setItem('type',res.data.waijian)
    })
  }
  }
}
</script>

<style scoped>

</style>
